﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace System
{
    public static class Extensions
    {

        public static void MessageBox(this Exception ex)
        {
            System.Windows.Forms.MessageBox.Show(ex.Message,
                "Error",
                MessageBoxButtons.OK,
                MessageBoxIcon.Error);
        }

        public static void Warning(this string text)
        {
            Warning(text, null);
        }

        public static void Warning(this string text, string title)
        {
            System.Windows.Forms.MessageBox.Show(text,
                title,
                MessageBoxButtons.OK,
                MessageBoxIcon.Warning);
        }

        public static void Error(this string text)
        {
            Error(text, null);
        }

        public static void Error(this string text, string title)
        {
            System.Windows.Forms.MessageBox.Show(text,
                title,
                MessageBoxButtons.OK,
                MessageBoxIcon.Error);
        }

        public static void Information(this string text)
        {
            Information(text, null);
        }
        public static void Information(this string text, string title)
        {
            System.Windows.Forms.MessageBox.Show(text,
                title,
                MessageBoxButtons.OK,
                MessageBoxIcon.Information);
        }
    }
}
